package com.dc.designPattern._5_adapter._1_classAdapter;

/**
 * Description: 类适配器_适配器类
 * @author: gdc
 * @date: 2021/3/10
 * @version 1.0
 */
public class VoltageAdapter extends Voltage220V implements IVoltage5V {

    @Override
    public int output5V() {
        // 获取原始电压
        int originVoltage = output220V();
        // 通过复杂的业务逻辑转换为 5V
        int targetVoltage = originVoltage / 44;
        return targetVoltage;
    }
}
